package com.yanghang.config;


import com.yanghang.filter.AccessControlAllowFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyConfig implements WebMvcConfigurer {
    @Bean
    public FilterRegistrationBean filterReister(){
        FilterRegistrationBean fr = new FilterRegistrationBean();
        fr.setFilter(new AccessControlAllowFilter());
        fr.addUrlPatterns("/*");
        return fr;
    }
}
